public class UserFactory {

    public UserOfRela createUser(String type){
        if(type.equals("Musician")) {
            Musician musician = new Musician();
            System.out.println("创建了一个新的音乐人账户：" + musician);
            return musician;
        }
        else if ("Listener".equals(type)){
            Listener listener = new Listener();
            System.out.println("创建了一个新的普通账户：" + listener);
            return listener;
        }else {
            System.out.println("不存在这样的用户身份");
            return null;
        }
    }
}
